URL = 'http://localhost:8601/';
var token= localStorage.getExpire("token");
$(function () {
    layer.msg('hello');
    layui.use('table', function () {
        //第一个实例
        var table = layui.table;
        table.render({
            xhrFields: {
                withCredentials: true
            },
            headers:{"Authorization":token},
            elem: '#demo'
            , page: true
            , toolbar: '#header'
            , url: URL + 'Article/listArticleAll' //数据接口
            , cols: [[ //表头
                {field: 'article_id', title: '文章管理', templet: '#titleTpl'}
            ]]
        });
    });
});

function search() {
    var table = layui.table;
    table.reload('demo',{
        xhrFields: {
            withCredentials: true
        },
        headers:{"Authorization":token},
        where: { //设定异步数据接口的额外参数，任意设
            name:$("#text").val()
        }
        , page: {
            curr: 1 //重新从第 1 页开始
        }
    })
}
